import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NgZorroAntdModule, NzMessageService } from 'ng-zorro-antd';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MainLayoutModule } from '../../comm-components/main-layout/main-layout.module';
import { ShopComponent } from "./shop.component";
import { routing } from './shop-routing.module';
import { ShopService } from "./shop.service";
import { HttpService } from "../../lib/service/http.service";
import { LocalStorageService } from "../../lib/service/local-storage.service";
import { AddComponent } from './add/add.component';
import { EditComponent } from './edit/edit.component';
import { ListComponent } from './list/list.component';


@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    routing,
    NgZorroAntdModule.forRoot(),
    MainLayoutModule,
  ],
  declarations: [
    ShopComponent,
    AddComponent,
    EditComponent,
    AddComponent,
    EditComponent,
    ListComponent
  ],

  providers: [
    {
      provide: ShopService,
      deps: [HttpService, LocalStorageService],
      useFactory(http: HttpService, localStorage: LocalStorageService) {
        return new ShopService(http, localStorage);
      }
    },
  ]
})
export class ShopModule { }

